package pl.edu.agh.logview.webservice;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class MessageBeanAdapter extends XmlAdapter<MessageBeanImpl, MessageBean> {
    public MessageBeanImpl marshal(MessageBean v) throws Exception {
        if (v instanceof MessageBeanImpl) {
            return (MessageBeanImpl)v;
        }
        return new MessageBeanImpl(v.getType(),v.getName(),v.getTime(),v.getFromAgent(),v.getToAgent());
    }

    public MessageBean unmarshal(MessageBeanImpl v) throws Exception {
        return v;
    }
}
